From cdc5a0c76878353994a623ab24c34600716c8702 Mon Sep 17 00:00:00 2001 From: robertl Date: Sun, 16 Nov 2003 20:10:38 +0000 Subject: [PATCH] Unify math.h includes and conditional M_PI definition since we kept getting it wrong... --- copilot.c | 4 ---- defs.h | 8 ++++++++ grtcirc.c | 5 ----- polygon.c | 6 ------ position.c | 2 -- psp.c | 1 - 6 files changed, 8 insertions(+), 18 deletions(-) diff --git a/copilot.c b/copilot.c index 5bba68a98..8ceee66d1 100644 --- a/copilot.c +++ b/copilot.c @@ -22,10 +22,6 @@ #include "defs.h" #include "coldsync/palm.h" #include "coldsync/pdb.h" -#include "math.h" -#ifndef M_PI -#define M_PI 3.14159265358979323846 -#endif static double conv = 180.0 / M_PI; diff --git a/defs.h b/defs.h index 22161ed78..b838212af 100644 --- a/defs.h +++ b/defs.h @@ -25,6 +25,14 @@ #include #include "queue.h" + +/* + * Amazingly, this constant is not specified in the standard... + */ +#ifndef M_PI +# define M_PI 3.14159265358979323846 +#endif + /* * Common definitions. There should be no protocol or file-specific * data in this file. diff --git a/grtcirc.c b/grtcirc.c index 0106e1216..d059e3c84 100644 --- a/grtcirc.c +++ b/grtcirc.c @@ -19,13 +19,8 @@ */ #include -#include #include "defs.h" -#ifndef M_PI -# define M_PI 3.14159265358979323846 -#endif - static void crossproduct( double x1, double y1, double z1, double x2, double y2, double z2, double *xa, double *ya, double *za ) { diff --git a/polygon.c b/polygon.c index d68e92d06..2cc00b020 100644 --- a/polygon.c +++ b/polygon.c @@ -18,14 +18,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 USA */ -#include -#include #include "defs.h" -#ifndef M_PI -# define M_PI 3.14159265358979323846 -#endif - #define MYNAME "Polygon filter" extern queue waypt_head; diff --git a/position.c b/position.c index a1f016a80..f1100bcfa 100644 --- a/position.c +++ b/position.c @@ -18,8 +18,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 USA */ -#include -#include #include "defs.h" #include "grtcirc.h" diff --git a/psp.c b/psp.c index 20737ef34..4aacd5cd9 100644 --- a/psp.c +++ b/psp.c @@ -22,7 +22,6 @@ #include "defs.h" #include -#include /* for M_PI */ #ifndef M_PI # define M_PI 3.14159265358979323846 -- 2.30.2